<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<div th:replace="common/header::header('我的成绩')"></div>
<body>
<div id="wrapper" class="row">
    <div th:replace="common/header::nav"></div>
    <div id="page-inner">
        <!--我的成绩存在时显示-->
        <th:block th:if="${myExam}">
            <div class="row">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>考试名称</th>
                                <th>考试时间</th>
                                <th>分数</th>
                            </tr>
                            </thead>
                            <tbody>
                            <th:block th:each="e:${myExam}">
                                <tr th:object="${e.exam}">
                                <td th:text="*{name}">1</td>
                                <td th:text="*{#dates.format(time, 'yyyy-MM-dd HH:mm')}">2018-5-4</td>
                                <td th:text="${e.score}">100</td>
                            </tr>
                            </th:block>
                            <tr th:unless="${#lists.size(myExam)>0}">
                                <td colspan="3">未查询到相应考试信息！</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /. ROW  -->
        </th:block>
        <!--我的成绩搜索时显示-->
        <th:block th:if="${search}">
            <div class="row">
                <div class="col-md-6 col-md-offset-3">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <tbody>
                            <form action="/erems/examinee/score" method="post">
                            <tr>
                                <td>
                                    <select name="id">
                                        <option value="0">全部成绩</option>
                                        <th:block th:each="s:${search}">
                                            <option th:value="${s.key}" th:text="${s.value}"></option>
                                        </th:block>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td><button class="btn btn-primary" type="submit">查询</button></td>
                            </tr>
                            </form>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- /. ROW  -->
        </th:block>
    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. WRAPPER  -->

<div th:replace="common/footer"></div>
</body>
</html>